package com.huan.listener;

import com.huan.util.Constants;

import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpSessionBindingEvent;
import javax.servlet.http.HttpSessionBindingListener;

@WebListener
public class UserOnlineListener implements HttpSessionBindingListener {

    public UserOnlineListener()
    {
    }


    @Override
    public void valueBound(HttpSessionBindingEvent event)
    {
        Constants.ONLINE_USER_COUNT++;
    }


    @Override
    public void valueUnbound(HttpSessionBindingEvent event)
    {
        Constants.ONLINE_USER_COUNT--;
    }
}
